package com.dxd.onlineshop.service;

import com.dxd.onlineshop.pojo.Address;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface AddressService {
    List<Address> getUserAddresses(Long userId);

    Address getAddress(Long id);

    @Transactional
    void addAddress(Address address) throws Exception;

    @Transactional
    void updateAddress(Long userId, Address address) throws Exception;

    @Transactional
    void deleteAddress(Long userId, Long id) throws Exception;

    @Transactional
    void setDefaultAddress(Long userId, Long addressId) throws Exception;

    int getAddressCount(Long userId);
}